$558F0: Given halfword in r0 -> r4
	Get VarMem pointer; advance to +$BA0, Options; check bit 0x04, (UNKNOWN)
	If not set, index from 0x8211770; if set, index from 0x8210370
	Add input*4 to index, load word, and return
	The thing is, both of these pointer tables are identical!
	Was this dummied out from the Japanese version..?


$05B278: General special tile handling routine
	-For spiked tiles, breakable floors, exits...
	r1 = offset of special tile data, in condensed memory form
	r5 = map data memory?


Indexes table $82160D0 (map misc data) for area you are leaving and the one you're entering
	Sets Battle BG according to map's BG

	-Also run when swapping between dungeon floors

$05B2BC: General event-loading?

$05B9E4: When interacting with a special tile or NPC, or any other map feature
	-r0 = (memory pointer)
	-r1 = Event ID
	If Event ID > 0x2327, take ID-0x2328; index to pointer table at 0x8006A98; load mapMem+0x7DAC to r0
	If 0x1F3F < Event ID < 0x2328, take ID-0x1F40; index to pointer table at 0x80073A0
	If 0x1387 < ID < 0x1F3F, take ID-0x1388; index to pointer table at 0x08007788
	If 0xF9F < ID < 0x1388, take ID-0xFA0; index to pointer table at 0x08007900
		-Only 0xFA0 to 0xFAE will work normally
	Branch to 0x667D4: clears out some space in the stack, stores event data pointer there too

	Event Commands

$05BAA4: Routine where event commands are loaded and executed, based on IDs in event script
	-Given first byte in event command, loads different routine to use

$05BF48: Code for event command 0x0; terminates event script

$05C15C: Code for event command 0x05; load+store text pointer, open dialog window?
	-Loads [MapMem+$7DAC] into r2; load also the event script pointer
	-If r2+0x48 has bit 0 clear (first time running this), load param+$2 as halfword (dialogue text index); if not 0xFFFF,
	branch to 0x558F0 (load text pointer for this dialogue index)
	-Store that pointer to r2+0x4C...and a bunch more little values in other spots (+50,+51,+52...)
	-If param+$4 is nonzero, print text box at bottom of screen; set bit 0x4 in r2+$48
	-Put MapMem pointer in r0, branch to $5BB8C
	-(some stuff I haven't looked at)
	-This routine is repeated every frame until ?? (text box has fully expanded)

$05C4C0: Code for event command 0x6; close text box
	If param +$3 is zero, the text box will close immediately; otherwise it will wait for the player to press A

$05C704: Code for event command 0x9; wait
	-Repeat this command for param $2 frames

$05C834: Code for event command 0xD; jump to one of two?

$05CA34: Code for event command 0x2D; conditional jump based on ID, or event flag manipulation
	-Gets VarMem pointer; gets MapMem+$7DAC (loc of current script pointer)
	-Loads param +$3; if 0xB or lower, use as index to jump table:
		$0: Set main event flag of ID p+$2
		$1: Clear main event flag of ID p+$2
		$2: Checks given main event ID using $065460
			-If not set, jump
		$7: Checks given bit in event data in stack
		$8: Branches to $158C4 to set bit of (param+$2) in the event state bitfield
			Then adds byte param+$1 to location (usually 0x4 in this case!)
		$9: Loads param+$2, VarMem+$71C; branch to $158C4 to clear that ID's state?
			-Then add byte param+$1 to script location
		$A: Same as $B, but check is reversed
		$B: Loads param+$2, VarMem+$71C; branch to $158E8 to check that ID's state in bitfield
			-If bit is set, set param+$4 pointer as script location
			-If not, add byte param+$1 (command length) to script location

$05CC10: Code for event command 0x11; music and sound-related commands
	-Depending on param+$3's value, indexes to jump table; values 00-0F permitted
	$00: Play sound of ID param+$4-5
	$01: Play music of ID param+$4-5
	$02: Copy +$44 (in stack data) to +$42, and play music
	$03: Play music of ID from +$42
	$04: ? Something music-related
	$05: ?
	$06: ?
	$07: Do nothing
	$08: Do nothing
	$09: ?
	$0A: Wait until sound effect is finished, then move on?
	$0B: Do nothing
	$0C: Set bit 0x1000 on +$48
	$0D: Clear bit 0x1000 on +$48
	$0E: ?
	$0F: ?

$05CE9C: Code for event command 0x12; Load sprite	
	If param+$3 is 0x0:
		-Load X-coord from param+$6 and Y-coord from param+$8
		-Then continue as in 0x1
		-So, load PC sprite at specified coords
	If param+$3 is 0x1:
		-Load party's X- and Y-coords 
		param+$2 indicates which PC in party to load sprite for?
		Use it to index to that PC's data, load their class
		-So, load a sprite from the party at their current coords
	Otherwise, set X- and Y-coords to zero and continue as in 0x1
	Branch to 0x05A664 to load the sprite
	
$05D0D4: Code for event command 0x14; Remove sprite
	If param +$3 is 0x1, add 0x20 to param +$2
	Get param +$2'th NPC, unset visibility and remove entirely

$05D17C: Code for event command 0x15; Move party
	Get MapMem+$90B4, VarMem+$8 in r0,r1
	Index param+$3 (speed) to halfword table at $216084 to r3
	Load param+$4 (direction) as a word to r2
	Store param+$2 (distance), MapMem +$BE0 to stack
	With p+$2 as distance, p+$3 as speed index, $4 as direction, Branch to $59D30 to start moving
	Also reset party facing if needed

$05D288: Code for event command 0x1B; fade in and out
	Depending on param+$4, fade different things
	0xFFFF: Fade all
	0xFF00: Fade NPCs only?
	
$05D408: Code for event command 0x1C; does something to an NPC...

$05D77C: Code for event command 0x26; 
	-Load party's current orientation, and param+$2
	-If both are the same, do nothing
	-Otherwise, set party orientation to the new param, and
	do some weirdness with MapMem+$9050 region (to update party sprite?)

$05D7F8: Code for event command 0x27; print dialog text
	-First run: reset stack stuff that 0x05 modified?
	-Subsequent runs: Start printing text stored by 0x05
	-Loads text pointer; loads first byte of text data...working through text printing logic?
		-Reads option bits for message text delay
	-Repeat until all text is printed?

$05DC44: Code for event command 0x2A; price/gil related shenanigans
	Branch based on param $2:
	00: Store param +$4 into [MapMem+$7DAC] stack struct +$18
	01: Check map ID against hardcoded set of inn maps; store associated prices
	02: Check map ID against hardcoded set of chapel maps; store associated prices
	03: Compare party gold with price stored in stack struct +$18
		If greater, move to next command
		Else, load pointer in param +$4 and make that the next command
	04: Get price stored in stack struct; branch to $7F100 (subtract stored price from gil)
	05: Add gil stored in stack struct to party total; branch to $7F11C to do it

$05DF10: Code for event command 0x2E; remove trigger for event
	-Loads param+$2, event ID; branches to $5B1F0 to calc event trigger info, store that to stack
	-First goes through all tile events, then sprites, looking for event ID
	-If and when it finds it, the event trigger is erased from the tile/NPC
	
$05E0B4: Code for event command 0x30; various NPC functions
	-Does stuff like unsetting visibility, collision for certain sprites, based on mode byte:
		02: Unsets bit 0x02 NPC's state bitfield, removing the visibility/interactibility flag
		03: 
		04: Unsets bit 0x20 in NPC's state bitfield, turning off collision

$05E318: Code for event commmand 0x37; add item to party's inventory
	-If param +$2 has bit 0x80 set, add [VarMem+$74C]*4 to param+$3 and index to $218596
	to load item selection param
		-For the trading quest items in the Soul of Chaos
	-If not, just use param +$3 as the selection param
	-Index to event item table at $2183B4; load item type and ID
	-Now, if p +$2 is 0x1, remove one copy of the item from inventory
	-If 0x0, add one
	-If 0x2, check if at least one is already in your inventory
		-If not, use param +$4 as next event address

$05E444: Code for event command 0x39; modify party member HP/MP
	Use jump table depending on param +$2's value (00-04 allowed)
		$00,$01: Do nothing
		$02: Apply tent-type item of param+$3 to all living party members
		$03: check character of param+$3's status; if param is FF, use active unit? +$1F
		anyway if alive, skip to end; else, remove Death status and set HP to 1; used for Clinics?
		$04: Depending on param +$3 value...
			0x0: Maximize all living PCs' HP
			0x1: Maximize all living PCs' MP
			0x2: Set all living PCs' HP to 1
			0x3: Set all living PCs' MP to 0

$05E654: Class Change effects routine; changes class, sprite etc for all four party members
	-among other things! Probably an event command

$05ECC0: Code for event command 0x60; do SOMEthing if MapMem+7DAC stack struct +$4 is nonempty...

$061A68: Code for event command 0x76; modify NPC sprite
	-Load param+$5;
	-If 0x1, load param+$2-3; use that to branch to $5B1F0, to store that+derived bytes to stack
	-Now search through map's features to find NPC that matches the input event index

$0662A0: Code for event command 0x42; jump based on player direction facing
	0x0 (down): advance to next command
	0x1 (up): jump to (p+$4) in event execution
	0x2 (right): jump to (p+$8)
	0x3 (left): jump to (p+$C)

$066450: Code for event command 0x1F; change sprite's animation frame
	Finds sprite's data in MapMem, indexed with param +$2
	Sets to animation of param +$3
	Also disables normal animations?
	
$066494: Code for event command 0x18; shifting sprite by pixels
	-Depending on mode byte +$3, shifts sprite ($2) by ($4) pixels; negative numbers acceptable

$0664E8: Code for event command 0x16; Vanish/reveal party leader
	If param +$2 is 0x0:
		-Load MapMem +$90D8; clear bit 00, vanishing leader
		-Otherwise set it, rendering them visible

$0665C8: Code for event command 0x1
	-Does nothing; only advances to the next command
	(well, by the value in param+1...)

$0667D4: Reading events

